package com.study.装配bean注解;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @author chenhs
 * @date 2019/9/8
 */
@Service
//@Scope(value = "prototype")  //控制生命周期  默认单例  prototype 变为多例模式
public class StudentServiceImpl  implements IStudentService {
	private  IStudentDao iStudentDao;
	@Autowired
	@Qualifier(value = "studentDao")
	public void setiStudentDao(IStudentDao iStudentDao) {
		this.iStudentDao = iStudentDao;
	}
	
	public  void  addStudent(){
		System.out.println("service");
		iStudentDao.add();
	}
	//@PostConstruct
	public  void init(){
		System.out.println("注解配置初始化方法");
	}
	//@PreDestroy
	public  void destroy(){
		System.out.println("注解配置销毁方法");
	}
}
